﻿using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;

namespace SBPweb.PhotoGallery.Client
{

    public class ButtonPresenterControl : UserControl
    {

        #region Dependency property definitions

        public static readonly DependencyProperty ButtonBackgroundProperty = DependencyProperty.Register("ButtonBackground", typeof(Brush), typeof(ButtonPresenterControl), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
        public static readonly DependencyProperty ButtonForegroundProperty = DependencyProperty.Register("ButtonForeground", typeof(Brush), typeof(ButtonPresenterControl), new PropertyMetadata(new SolidColorBrush(Colors.White)));
        public static readonly DependencyProperty ButtonAlternateForegroundProperty = DependencyProperty.Register("ButtonAlternateForeground", typeof(Brush), typeof(ButtonPresenterControl), new PropertyMetadata(new SolidColorBrush(Colors.Black)));

        #endregion

        #region Constructor logic

        protected virtual void InitializeProperties()
        {
            ButtonForeground = (Brush)this.GetValue(ButtonForegroundProperty);
            ButtonAlternateForeground = (Brush)this.GetValue(ButtonAlternateForegroundProperty);
            ButtonBackground = (Brush)this.GetValue(ButtonBackgroundProperty);
        }

        protected virtual void InitializeHandlers()
        {
            this.SizeChanged += new SizeChangedEventHandler(ViewToolBar_SizeChanged);
        }

        #endregion

        #region Property accessors

        public virtual Brush ButtonForeground
        {
            get
            {
                return (Brush)GetValue(ButtonForegroundProperty);
            }
            set
            {
                SetValue(ButtonForegroundProperty, value);
            }
        }

        public virtual Brush ButtonAlternateForeground
        {
            get
            {
                return (Brush)GetValue(ButtonAlternateForegroundProperty);
            }
            set
            {
                SetValue(ButtonAlternateForegroundProperty, value);
            }
        }

        public virtual Brush ButtonBackground
        {
            get
            {
                return (Brush)GetValue(ButtonBackgroundProperty);
            }
            set
            {
                SetValue(ButtonBackgroundProperty, value);
            }
        }

        #endregion

        #region Event handlers

        protected virtual void ViewToolBar_SizeChanged(object sender, SizeChangedEventArgs e)
        {
        }

        #endregion

    }

}